package com.qf.service.impl;

import com.qf.dao.AccountDao;
import com.qf.service.AccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 千锋教育
 * @Company http://www.mobiletrain.org/
 * @Version 1.0
 */
@Service("accountService")
//@Scope("SINGLETON")
//@Scope("PROTOTYPE")
//@Transactional(isolation = Isolation.DEFAULT, propagation = Propagation.SUPPORTS, timeout = -1 ,readOnly = true, rollbackFor = Exception.class)
public class AccountServiceImpl implements AccountService {



//    @Autowired(required = false)
//    @Qualifier("interfaceTestImplA")
//    @Resource(name = "interfaceTestImplA")
//    InterfaceTest interfaceTest;

    @Autowired
    AccountDao accountDao;

//    @PostConstruct
//    @PreDestroy
//    public void setAccountDao(AccountDao accountDao) {
//        this.accountDao = accountDao;
//    }

    @Override
    public void transfer(String fromName, String toName, double money) {
        accountDao.minusAccount(fromName ,money);
        int i = 1/0;
        accountDao.plusAccount(toName ,money);
    }


}
